package com.jzo2o.trade.controller;

import com.jzo2o.trade.service.IPaySuccessService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

/**
 * \* User: chy
 * \* Date: 2025/10/10  14:28
 * \* Description:
 * \
 */
@RestController
@RequestMapping("/aliPay/notify")
@Slf4j
public class AliNotifyController {

    @Resource
    private IPaySuccessService paySuccessService;
    @RequestMapping
    public String aliNotify(HttpServletRequest  request){
        log.info("支付宝回调开始");
        String outTradeNo = request.getParameter("out_trade_no");
        paySuccessService.updateTradingState(outTradeNo);
        log.info("订单号：{}",outTradeNo);
        return "success";
    }
}
